package com.ruoyi.ucar.domain;

import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.core.domain.UCarBaseEntity;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;

/**
 * 订单主对象 t_order
 * 
 * @author sungangbin
 * @date 2025-05-13
 */
@TableName("t_order")
@Data
public class TOrder extends UCarBaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 主键 */
    @TableId(value="id",type = IdType.AUTO)
    private Long id;

    /** 订单主表主键UUID */
    @Excel(name = "订单主表主键UUID")
    @TableField("order_uuid")
    private String orderUuid;

    /** 订单编号-唯一-时间戳 */
    @Excel(name = "订单编号-唯一-时间戳")
    @TableField("order_code")
    private String orderCode;

    /** 关联客户UUID-指向客户主表 */
    @Excel(name = "关联客户UUID-指向客户主表")
    @TableField("customer_uuid_mapping")
    private String customerUuidMapping;

    /** 订单类型-字典 */
    @Excel(name = "订单类型-字典")
    @TableField("order_type")
    private String orderType;

    /** 订单状态 */
    @Excel(name = "订单状态-字典")
    @TableField("order_status")
    private String orderStatus;

    /** 订单状态 */
    @Excel(name = "支付状态-字典")
    @TableField("pay_status")
    private String payStatus;

    /** 订单失效日期时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "订单失效日期时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    @TableField("order_failure_datetime")
    private LocalDateTime orderFailureDatetime;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "订单支付日期时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    @TableField("pay_datetime")
    private LocalDateTime payDatetime;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "订单下单日期", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    @TableField("start_datetime")
    private LocalDateTime startDatetime;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "订单退单日期", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    @TableField("charge_datetime")
    private LocalDateTime chargeDatetime;

    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "返现到期日期", width = 30, dateFormat = "yyyy-MM-dd")
    @TableField("return_price_date")
    private LocalDate returnPriceDate;

    @Excel(name = "订单总计实际价")
    @TableField("total_real_price")
    private BigDecimal totalRealPrice;

    @Excel(name = "订单总计标准价")
    @TableField("total_price")
    private BigDecimal totalPrice;

    @Excel(name = "订单总计进价")
    @TableField("total_purchasing_price")
    private BigDecimal totalPurchasingPrice;

    @Excel(name = "总计返现价格")
    @TableField("total_return_price")
    private BigDecimal totalReturnPrice;

    /** 代理费 */
    @Excel(name = "代理费")
    @TableField("agency_fee")
    private BigDecimal agencyFee;

    @Excel(name = "签名图片文件UUID")
    @TableField("sign_file_main_uuid")
    private String signFileMainUuid;

    /** 创建人 */
    @Excel(name = "创建人")
    @TableField("created_by")
    private String createdBy;

    /** 创建时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd")
    @TableField("created_time")
    private Date createdTime;

    /** 更新人 */
    @Excel(name = "更新人")
    @TableField("updated_by")
    private String updatedBy;

    /** 更新时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "更新时间", width = 30, dateFormat = "yyyy-MM-dd")
    @TableField("updated_time")
    private Date updatedTime;

    /** 删除标志 */
    @Excel(name = "删除标志")
    @TableField("delete_flag")
    private Long deleteFlag;

    @Excel(name = "微信支付订单号")
    @TableField("transaction_id")
    private String transactionId;


    @Excel(name = "报告未读标志")
    @TableField("unread_flag")
    private Long unreadFlag;

    @Excel(name = "是否已返现   0：无返现  1：未领取返现  2:已领取返现")
    @TableField("is_return_price")
    private Integer isReturnPrice;


    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("orderUuid", getOrderUuid())
            .append("orderCode", getOrderCode())
            .append("customerUuidMapping", getCustomerUuidMapping())
            .append("orderType", getOrderType())
            .append("orderStatus", getOrderStatus())
            .append("createdBy", getCreatedBy())
            .append("createdTime", getCreatedTime())
            .append("updatedBy", getUpdatedBy())
            .append("updatedTime", getUpdatedTime())
            .append("deleteFlag", getDeleteFlag())
            .append("payStatus", getPayStatus())
            .append("orderFailureDatetime", getOrderFailureDatetime())
            .append("payDatetime", getPayDatetime())
            .append("startDatetime", getStartDatetime())
            .append("chargeDatetime", getChargeDatetime())
            .append("totalRealPrice",  getTotalRealPrice())
            .append("totalPrice",  getTotalPrice())
            .append("totalPurchasingPrice", getTotalPurchasingPrice())
            .append("totalReturnPrice", getTotalReturnPrice())
            .append("agencyFee", getAgencyFee())
            .append("signFileMainUuid", getSignFileMainUuid())
             .append("transactionId", getTransactionId())
              .append("unreadFlag", getUnreadFlag())
                .append("isReturnPrice", getIsReturnPrice())
                .append("returnPriceDate", getReturnPriceDate())
                .toString();
    }
}
